# -*- coding: utf-8 -*-

import sip
sip.setapi('QString', 2)
sip.setapi('QStringList', 2)
sip.setapi('QVariant', 2)

from PyQt4 import QtCore

#_______________________________________________________________________________
class CollectionTreeConfigView(QtCore.QObject):
    combobox_items = ['None', 'Artist', 'Album', 'Genre', 'Year']
    
    def __init__(self, ui):
        QtCore.QObject.__init__(self)
        self.ui = ui
        self.comboboxes = [self.ui.collection_level_0_combobox, 
                           self.ui.collection_level_1_combobox, 
                           self.ui.collection_level_2_combobox]
        self.frame = ui.collection_settings_frame
        self.conf_button = ui.conf_button
        self.conf_button.setEnabled(False)
    
    def set_model(self, model):
        """FIXME: usare currentIndexChanged"""
        self.model = model
            
    def set_current_text(self, level, text):
        index = self.comboboxes[level].findText(text)
        self.comboboxes[level].setCurrentIndex(index)
